﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using QLTB.Data;
using QLTB.Entities;

namespace _4rumDCT.App_Code
{
    public class BindCatalog
    {
        public BindCatalog()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public static void BindPhongHoc(DropDownList cboCatalog)
        {
            TList<PhongHoc> TList_Catalog = DataRepository.PhongHocProvider.GetAll();
            cboCatalog.DataSource = TList_Catalog;
            cboCatalog.DataTextField = "TenPhong";
            cboCatalog.DataValueField = "MaPhong";
            cboCatalog.DataBind();
            ListItem ItemChoose = new ListItem();
            ItemChoose.Text = " -- Chọn Phòng --";
            ItemChoose.Value = "0";
            cboCatalog.Items.Insert(0, ItemChoose);
        }

        public static void BindLoaiTinhTrang(DropDownList cboCatalog)
        {
            TList<LoaiTinhTrang> TList_Catalog = DataRepository.LoaiTinhTrangProvider.GetAll();
            cboCatalog.DataSource = TList_Catalog;
            cboCatalog.DataTextField = "TenLoaiTinhTrang";
            cboCatalog.DataValueField = "MaLoaiTinhTrang";
            cboCatalog.DataBind();
            ListItem ItemChoose = new ListItem();
            ItemChoose.Text = " -- Chọn Loại tình trạng --";
            ItemChoose.Value = "0";
            cboCatalog.Items.Insert(0, ItemChoose);
        }

        public static void BindKieuSapXep(DropDownList cboCatalog)
        {
            int TotalRows = 0;
            string WhereClause = "1=1";
            TList<KieuSapXep> TList_Catalog = DataRepository.KieuSapXepProvider.GetPaged(WhereClause, "MaKieu ASC", 0, 0, out TotalRows);
            cboCatalog.DataSource = TList_Catalog;
            cboCatalog.DataTextField = "TenKieu";
            cboCatalog.DataValueField = "MaKieu";
            cboCatalog.DataBind();
            ListItem ItemChoose = new ListItem();
            ItemChoose.Text = " -- Chọn Kiểu sắp xếp --";
            ItemChoose.Value = "0";
            cboCatalog.Items.Insert(0, ItemChoose);
        }

        public static void BindCanBo(DropDownList cboCatalog)
        {
            int TotalRows = 0;
            string WhereClause = "1=1";
            TList<CanBo> TList_Catalog = DataRepository.CanBoProvider.GetPaged(WhereClause, "MaCanBo ASC", 0, 0, out TotalRows);
            cboCatalog.DataSource = TList_Catalog;
            cboCatalog.DataTextField = "HoTen";
            cboCatalog.DataValueField = "MaCanBo";
            cboCatalog.DataBind();
            ListItem ItemChoose = new ListItem();
            ItemChoose.Text = " -- Chọn Cán bộ --";
            ItemChoose.Value = "0";
            cboCatalog.Items.Insert(0, ItemChoose);
        }

        public static void BindLopHocPhan(DropDownList cboCatalog)
        {
            int TotalRows = 0;
            string WhereClause = "1=1";
            TList<LopHocPhan> TList_Catalog = DataRepository.LopHocPhanProvider.GetPaged(WhereClause, "MaLopHP ASC", 0, 0, out TotalRows);
            cboCatalog.DataSource = TList_Catalog;
            cboCatalog.DataTextField = "TenLopHP";
            cboCatalog.DataValueField = "MaLopHP";
            cboCatalog.DataBind();
            ListItem ItemChoose = new ListItem();
            ItemChoose.Text = " -- Chọn Lớp học phần --";
            ItemChoose.Value = "0";
            cboCatalog.Items.Insert(0, ItemChoose);
        }

        public static void BindQuyenThanhVien(DropDownList cboCatalog)
        {
            int TotalRows = 0;
            string WhereClause = "1=1";
            TList<QuyenCanBo> TList_Catalog = DataRepository.QuyenCanBoProvider.GetPaged(WhereClause, "MaQuyen ASC", 0, 0, out TotalRows);
            cboCatalog.DataSource = TList_Catalog;
            cboCatalog.DataTextField = "TenQuyen";
            cboCatalog.DataValueField = "MaQuyen";
            cboCatalog.DataBind();
            ListItem ItemChoose = new ListItem();
            ItemChoose.Text = " -- Chọn Quyền cán bộ --";
            ItemChoose.Value = "0";
            cboCatalog.Items.Insert(0, ItemChoose);
        }

        //public static IDictionary<short?, string> GioiTinh
        //{
        //    get
        //    {
        //        Dictionary<short?, string> gioiTinh = new Dictionary<short?, string>();

        //        gioiTinh.Add(1, vilanguage.NAM);
        //        gioiTinh.Add(2, vilanguage.NU);
        //        return gioiTinh;
        //    }
        //}

        //public static IDictionary<short?, string> GioiTinhEN
        //{
        //    get
        //    {
        //        Dictionary<short?, string> gioiTinhen = new Dictionary<short?, string>();

        //        gioiTinhen.Add(1, enlanguage.NAM);
        //        gioiTinhen.Add(2, enlanguage.NU);
        //        return gioiTinhen;
        //    }
        //}

       
    }
}